package learn.emp01.ex05;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextDouble()){
            String choice = scanner.next();
            System.out.println("choice=" + choice);
            switch (choice) {
                case "double":
                    handleDouble(scanner);
                    break;
                case "int":
                    handleInt(scanner);
                    break;
                case "line":
                    handleLine(scanner);
                    break;
                default:
                    System.out.println("other");
            }
        }
        scanner.close();
    }

    private static void handleInt(Scanner scanner) {
        double num1 = scanner.nextDouble();
        double num2 = scanner.nextDouble();
        double num3 = scanner.nextDouble();
        System.out.printf("%-5.2f,%5.2f,%.2f/n",num1,num2,num3);
    }

    private static void handleDouble(Scanner scanner) {
        int num1 = scanner.nextInt();
        int num2 = scanner.nextInt();
        int num3 = scanner.nextInt();
        System.out.println(num1 + num2 + num3);
    }
    private static void handleLine(Scanner scanner) {
        scanner.nextLine();
        String line = scanner.nextLine();
        System.out.println(line.toUpperCase());
    }
}